package com.sf.template.course;

/**
 * @author 埔枘
 * @date 2019/12/02
 **/
public abstract class NetWorkCourse {

    public void createCourse(Teacher teacher){
        //1.上传预习资料
        this.uploadPreResource();
        //2.制作ppt
        this.createPPT();
        //.....
        //3.交作业
        this.createUpHomeWork();
        //钩子方法
        if(this.needCheck()){
            this.checkHomeWork();
        }
        //4.批改作业
        this.orrect(teacher);
    }

    protected void orrect(Teacher teacher){
        teacher.correct();
    }

    protected abstract void createUpHomeWork();

    final void checkHomeWork(){
        System.out.println("检擦作业");
    };

    protected boolean needCheck(){
        return false;
    };

    final void createPPT(){
        System.out.println("创建PPT");
    }

    final void uploadPreResource(){
        System.out.println("上传预习资料");
    };

}
